package com.example.myapplication;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.example.compress.CompressImage;

import java.io.File;

public class MainActivity extends AppCompatActivity {


    Bitmap inputBitmap = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        File input = new File(Environment.getExternalStorageDirectory(), "girl.jpg");
        Log.e("zdh", "---------------- input: " + input);
        inputBitmap = BitmapFactory.decodeFile(input.getAbsolutePath());
    }


    public void click(View view) {
        CompressImage.getInstance().nativeCompress(inputBitmap, 50, Environment.getExternalStorageDirectory() + "/girl2.jpg");
        Toast.makeText(this, "执行完成", Toast.LENGTH_SHORT).show();
    }
}